using System;
using System.ComponentModel;
using System.Xml.Serialization;

namespace com.exceptionalsoftware.spacetime.KML
{
	[Serializable()]
    [XmlType(TypeName = "OrientationType")]
    public class Orientation : ObjectType
	{
        private double headingField, tiltField, rollField;

        public Orientation()
		{
            this.headingField = 0;
            this.tiltField = 0;
            this.rollField = 0;
		}

        [XmlElement(ElementName = "heading", DataType = "double")]
        [DefaultValue(0)]
        public double Heading
        {
            get { return this.headingField; }
            set { this.headingField = Coordinate.NormalizeToRepeatingLimits(value, -360, 360); }
        }

        [XmlElement(ElementName = "tilt", DataType = "double")]
        [DefaultValue(0)]
        public double Tilt
        {
            get { return this.tiltField; }
            set { this.tiltField = Coordinate.NormalizeToRepeatingLimits(value, -360, 360); }
        }

        [XmlElement(ElementName = "roll", DataType = "double")]
        [DefaultValue(0)]
        public double Roll
        {
            get { return this.rollField; }
            set { this.rollField = Coordinate.NormalizeToRepeatingLimits(value, -360, 360); }
        }
    }
}